from rest_framework import serializers

from av_editor.serializers import MaterialFileBriefSerializer
from av_manager.models import PlatForm, ChannelSubscription, CarriedContent


class PlatFormSerializer(serializers.ModelSerializer):

    class Meta:
        model = PlatForm
        exclude = ["is_deleted"]
        extra_kwargs = {
            "password": {
                "write_only": True
            }
        }


class ChannelSubscriptionSerializer(serializers.ModelSerializer):

    class Meta:
        model = ChannelSubscription
        exclude = ["is_deleted"]

    def validate(self, attrs):
        
        return attrs


class CarriedContentSerializer(serializers.ModelSerializer):
    material = MaterialFileBriefSerializer(read_only=True)

    class Meta:
        model = CarriedContent
        exclude = ["is_deleted"]
